#pragma once
#include "HAL/Runnable.h"

//https://docs.unrealengine.com/en-US/API/Runtime/Core/HAL/FRunnable/index.html
class FTestRunnable : public FRunnable
{
public:
	FTestRunnable(FString ThreadName, class AMyTestRunnableActor* TestActor):MyThreadName(ThreadName), Tester(TestActor){}
	virtual bool Init() override;
	virtual uint32 Run() override;
	virtual void Exit() override;

	FString MyThreadName;
	class AMyTestRunnableActor* Tester;
private:
	int32 WorkCount = 0;

	static FCriticalSection CriticalSection;
};